package controller;
import model.*;
public class StaffController {

        private StaffContainer staffCont;
        
        public StaffController()
        {
            staffCont = StaffContainer.getInstance();
        }
        
        public Person findStaff(String address)
        {
            return staffCont.findPerson(address);
        }
        public boolean createStaff(String name, String address,String number,String cpr,String email,String phone,String type, String workplace)
        {
            Person staffObj = new Staff(name,phone,cpr,email,address,type,workplace);
            if(staffObj != null)
            {
                staffCont.addPerson(staffObj);
                return true;
            }
            else 
            {
                return false;
            }
            
        }
        
        public boolean updateStaff(String oldAddress, Customer newStaff){
            boolean success = false;
            success = staffCont.updatePerson(oldAddress, newStaff);
            return success;
        }
        public boolean removeStaff(String address) {
            if(findStaff(address)!=null) 
            {
                staffCont.removePerson(address);
                return true;
            }
            else 
            {
                return false;
            }
        }
        
    }